<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
.box{
    width: 500px;
    height: 500px;
    margin: auto;
}
#box1{
    width: 100px;
    background-color: black;
    height: 50px;
    margin-left:60px ;
}
</style>
</head>

<body>
    <div class="box">
        <button onclick="width()">变宽</button>
        <button onclick="height()">变高</button>
        <button onclick="color()">变色</button>
        <button onclick="show()">隐藏</button>
        <button onclick="chongzhi()">重置</button>
        <div id="box1">
        </div>
    </div>


</body>
</html>
<script>
    var add = document.getElementById("box1");
function width(){
    add.style.width="200px"
}
function height(){
    add.style.height="200px"
}
function color(){
    add.style. backgroundColor="red"
}
function chongzhi(){
    add.style=add
}
function show(){
  add.style.visibility="hidden";
}
</script>